package com.bjtu.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

@TableName("video")
@ApiModel("视频")
@Data
public class Video implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("视频id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户id")
    @TableField("user_id")
    @NotNull
    private Integer userId;

    @ApiModelProperty("标题")
    @TableField("title")
    @NotBlank
    private String title;

    @ApiModelProperty("视频url")
    @TableField("url")
    @NotBlank
    private String url;

    @ApiModelProperty("点赞数")
    @TableField("like_number")
    @NotNull
    private Integer likeNumber;

    @ApiModelProperty("创建时间")
    @TableField("create_time")
    @NotNull
    private LocalDateTime createTime;

    @ApiModelProperty("状态")
    @TableField("status")
    @NotNull
    private Integer status;

    @ApiModelProperty("是否被当前用户点赞")
    @TableField(exist = false) // 该字段在数据库中不存在
    private Integer isLiked;

}
